package com.vhall.component.entity.vote.vo.room;


import com.vhall.component.framework.common.annotation.ParamName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;


/**
 * <p>
 * 投票信息表
 * </p>
 *
 * @author longzhen.gong
 * @date 2021/7/6 13:49
 */
@Data
@EqualsAndHashCode()
@Accessors(chain = true)
public class VotesUpdateRoomRepVO implements Serializable {

    private static final long serialVersionUID = 1L;

    @NotNull(message = "vote_id参数异常")
    @ParamName(value = "vote_id")
    private Long voteId;

    /**
     * 标题
     */
    @Length(max = 50, message = "title参数错误")
    @ParamName("title")
    @NotBlank(message = "title参数异常")
    private String title;

    /**
     * 业务端扩展字段
     */
    @ParamName("extend")
    @NotBlank(message = "extend参数异常")
    private String extend;


    /**
     * 应用id
     */
    @ParamName("app_id")
    private String appId;

    /**
     * 是否是公开投票，1是0否，默认是
     */
    @ParamName("is_public")
    private Integer isPublic;


    /**
     * 投票限时时长 默认0 为不限时
     */
    @Pattern(regexp = "(60|120|300|1800|3600)", message = "limit_time参数异常")
    @ParamName("limit_time")
    @NotBlank(message = "limit_time参数异常")
    private String limitTime;

    /**
     * 可选选项数量 默认单选
     */
    @Range(min = 1, max = 10, message = "option_num 参数异常")
    @NotNull(message = "option_num 参数异常")
    @ParamName("option_num")
    private Integer optionNum;

    @NotBlank(message = "room_id参数异常")
    @ParamName("room_id")
    private String roomId;

}
